package cn.tedu.pojo;

import org.springframework.format.annotation.DateTimeFormat;

import java.util.Arrays;
import java.util.Date;
//封装网页中发来的数据
public class Student {
    private String user;//封装网页中输入的用户
    private int age;//封装网页中输入的年龄
    private int sex;//封装网页中选择的性别
    private String[] hobby;
    //封装网页中选择的多个爱好
    private int edu;//封装网页中选择的学历

    //格式化日期的:浏览器上选择的日期是string类型,要转成Date类型就要用注解,否则页面400
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date intime;//封装网页中填的日期
    //提供 set/get 和 toString
    public String getUser() { return user; }
    public void setUser(String user) { this.user = user; }

    public int getAge() { return age; }
    public void setAge(int age) { this.age = age; }

    public int getSex() { return sex; }
    public void setSex(int sex) { this.sex = sex; }

    public String[] getHobby() { return hobby; }
    public void setHobby(String[] hobby) { this.hobby = hobby; }

    public int getEdu() { return edu; }
    public void setEdu(int edu) { this.edu = edu; }

    public Date getIntime() { return intime; }
    public void setIntime(Date intime) { this.intime = intime; }

    @Override
    public String toString() {
        return "Student{" +
                "user='" + user + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                ", hobby=" + Arrays.toString(hobby) +
                ", edu=" + edu +
                ", intime=" + intime +
                '}';
    }
}
